import React, { Component } from "react";
//引入react-router-dom包
import { Switch, Redirect, Route } from "react-router-dom";
//引入组件
import Home from "../components/Home/Home";
import Shop from "../components/Shop/Shop";
import My from "../components/My/My";
import Detail from "../components/Detail/Detail";
import Cart from "../components/Cart/Cart";
import Address from "../components/Address/Address";
import Add_address from "../components/Add_address/Add_address";
export default class Router extends Component {
    render() {
        return (
            <Switch>
                <Route path="/home" component={Home}></Route>
                <Route path="/shop" component={Shop}></Route>
                <Route path="/my" component={My}></Route>
                <Route path="/detail" component={Detail}></Route>
                <Route path="/cart" component={Cart}></Route>
                <Route path="/address" component={Address}></Route>
                <Route path="/add_address" component={Add_address}></Route>
                <Redirect to="/home"></Redirect>
            </Switch>
        );
    }
}
